package cn.tedu.account.mapper;

import cn.tedu.account.entity.Account;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

public interface AccountMapper extends BaseMapper<Account> {
    // 扣减账户金额
    void decrease(@Param("userId") Long userId, BigDecimal money);
    // 查询账户
    Account selectByUserId(Long userId);
    // 可用Residue-->冻结Frozen
    void updateResidueToFrozen(Long userId,BigDecimal money);
    // 冻结Frozen-->已使用Used
    void updateFrozenToUsed(Long userId,BigDecimal money);
    // 冻结Frozen-->可用Residue
    void updateFrozenToResidue(Long userId,BigDecimal money);

}
